package com.artifact.mit.mypoint.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.artifact.mit.mypoint.adapter.TransferPointLeftTabAdapter;
import com.artifact.mit.mypoint.model.PointIssuer;
import com.artifact.mit.mypoint.R;

public class TPExternalSourceFragment extends Fragment {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		return inflater.inflate(R.layout.tp_external_resource_list, null);
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		ListView transferPoint = (ListView) getView().findViewById(R.id.listView1);
		
		TransferPointLeftTabAdapter transferPointAdapter = new TransferPointLeftTabAdapter(getActivity());
		//TODO : change point value
		transferPointAdapter.add(new PointIssuer(R.drawable.gff, "Garuda Frequent Flyer", "Point : 50.000", null));
		transferPointAdapter.add(new PointIssuer(R.drawable.acehardware, "Ace Hardware", "Point : 65.000", null));
		transferPointAdapter.add(new PointIssuer(R.drawable.blibli, "BliBli", "Point : 15.000", null));
		transferPointAdapter.add(new PointIssuer(R.drawable.toyskingdom, "Toys Kingdom", "Point : 5.000", null));
		transferPointAdapter.add(new PointIssuer(R.drawable.centro, "Centro", "Point : 25.000", null));

		transferPoint.setAdapter(transferPointAdapter);
	}
}
